package okl.test.motionChart.renderers
{
	import flash.display.DisplayObject;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	
	import mx.charts.chartClasses.DualStyleObject;
	import mx.charts.chartClasses.IAxis;
	import mx.charts.chartClasses.IAxisRenderer;
	import mx.containers.Box;
	import mx.containers.HBox;
	import mx.controls.Button;
	import mx.controls.Label;
	import mx.core.Container;
	import mx.core.UIComponent;
	
	import spark.components.Group;
	import spark.components.HGroup;
	import spark.components.Label;
	import spark.layouts.VerticalAlign;

	/**
	 *	@author "oleksandr.kulinchenko@gmail.com"
	 */
	public class _CustomRenderer extends DualStyleObject implements IAxisRenderer
	{

		public function _CustomRenderer()
		{
		}
		
		
		private var box1:Button;
		private var hbox:HBox;
		override protected function createChildren():void{
			super.createChildren();
			
			hbox = new HBox();
			
			hbox.setStyle("backgroundColor", 0x0000FF);
			hbox.setStyle("verticalAlign", VerticalAlign.MIDDLE);
			this.addChild(hbox);
			
			

			
			
			var box2:Box = new Box();
			box2.width=45;
			box2.height = 25;
			box2.setStyle("backgroundColor", 0x00FF00);
			addChild(box2);
	
			
		}
	
		
		
		override protected function measure():void{
			super.measure();
		}
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
		
			//gutters
			this.graphics.beginFill(0xFFFF00);
			this.graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
			
			var baseline:Point = new Point(gutters.left, unscaledHeight - gutters.bottom); 
			hbox.move(baseline.x, baseline.y);

			//cnt.width = unscaledWidth;
			//cnt.height = 50;
			//+ Number(showLine == true ? axisStroke.weight : 0) + tickSize(showLine);			
		}
		
		public var selectedDate:Date;
		//{region ILOGIC
		private var _axis:IAxis;
		public function get axis():IAxis
		{
			return _axis;
		}
		
		public function set axis(value:IAxis):void
		{
			_axis=value;
		}
		
		private var _gutters:Rectangle;
		public function get gutters():Rectangle
		{
			return _gutters;
		}
		
		public function set gutters(value:Rectangle):void
		{
			_gutters=value;
		}
		
		public function set heightLimit(value:Number):void
		{
		}
		
		public function get heightLimit():Number
		{
			return 0;
		}
		
		public function get horizontal():Boolean
		{
			return false;
		}
		
		public function set horizontal(value:Boolean):void
		{
		}
		
		public function get minorTicks():Array
		{
			return null;
		}
		
		public function set otherAxes(value:Array):void
		{
		}
		
		public function get placement():String
		{
			return null;
		}
		
		public function set placement(value:String):void
		{
		}
		
		public function get ticks():Array
		{
			return null;
		}
		
		public function adjustGutters(workingGutters:Rectangle, adjustable:Object):Rectangle
		{
			return workingGutters;
		}
		
		public function chartStateChanged(oldState:uint, v:uint):void
		{
		}
		//}endregion
	}
}